package com.woniuxy.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class DateUtil {
    public static Long parseDateString(String time, String pattern) {
        SimpleDateFormat sd = new SimpleDateFormat(pattern);
        long longtime = 0l;
        try {
            longtime = sd.parse(time).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return longtime;
    }

    public static String parseDateLong(Long time, String pattern) {
        SimpleDateFormat sd = new SimpleDateFormat(pattern);
        String strTime = null;

        strTime = sd.format(time);

        return strTime;
    }
}
